Example: Implement Clients for the Assess Service

Example: Implement Clients for the Assess Service

The following is intended to describe how to write clients that utilize the Generic and Specific Assess Service by using JAX-WS and .NET. It is assumed that the reader is reasonably proficient in web-service technology. Two samples are provided; one for generating client stub classes for JAX-WS using wsimport and the other for generating client stub classes using .NET.

 

Generating client stub classes for JAX-WS using wsimport

The wsimport tool reads the Assess WSDL file and generates artifacts such as the service endpoint interface (proxy object for calling operations on the web-service) and data objects that model the web-service data. The -d option specifies the target directory to store the generated client classes. The keep option ensures that the source files are kept along side the class files.

In the following example, the WSDL is the Assess Service of the example rulebase called RuleBaseWithSimpleRelationships.

wsimport -d D:/client_directory -keep http://localhost:8080/determinations-server/assess/soap/specific/10.2/RuleBaseWithSimpleRelationships?wsdl

Using the generated client stubs

The stub provides method calls that expose the available operations on the web-service (wsdl ports). In the case of the Assess Service, we have two available operations which are ListGoals and Assess.

Generating client stub classes using .NET

It's just a simple matter of point and click to generate a web-service assess client using Visual Studio. To generate the classes, go to Project -> Add Service Reference, paste the WSDL url in the Address field and click on Go. Then when you have located the right service, type in a namespace and click on Ok.